# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render
import json


def hello(request):
    context = {}
    context['hello'] = 'Hello World!'
    context['count'] = 2
    return render(request, 'hello.html', context)
    # return HttpResponse("Hello world ! ")


def jsonTest(request):
    result = {"status": "错误", "data": "", "city": "北京"}
    # json返回为中文
    return HttpResponse(json.dumps(result, ensure_ascii=False), content_type="application/json,charset=utf-8")
